Class: Twilio::REST::Voice::V2::RecordingContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Voice::V2::RecordingContext
- Defined in:
- lib/twilio-ruby/rest/voice/v2/recording.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the RecordingInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the RecordingInstanceMetadata.
-
#fetch ⇒ RecordingInstance
Fetch the RecordingInstance.
-
#fetch_with_metadata ⇒ RecordingInstance
Fetch the RecordingInstanceMetadata.
-
#initialize(version, id_or_unique_name) ⇒ RecordingContext
constructor
Initialize the RecordingContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(voice_v2_configuration_recording_request: :unset) ⇒ RecordingInstance
Update the RecordingInstance.
-
#update_with_metadata(voice_v2_configuration_recording_request: :unset) ⇒ RecordingInstance
Update the RecordingInstanceMetadata.
Constructor Details
#initialize(version, id_or_unique_name) ⇒ RecordingContext
Initialize the RecordingContext
173 174 175 176 177 178 179 180 181 182 |
# File 'lib/twilio-ruby/rest/voice/v2/recording.rb', line 173 def initialize(version, id_or_unique_name) super(version) # Path Solution @solution = { id_or_unique_name: id_or_unique_name, } @uri = "/Configurations/Recording/#{@solution[:id_or_unique_name]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the RecordingInstance
186 187 188 189 190 191 192 193 194 |
# File 'lib/twilio-ruby/rest/voice/v2/recording.rb', line 186 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#delete_with_metadata ⇒ Boolean
Delete the RecordingInstanceMetadata
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/twilio-ruby/rest/voice/v2/recording.rb', line 199 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) recording_instance = RecordingInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) RecordingInstanceMetadata.new(@version, recording_instance, response.headers, response.status_code) end |
#fetch ⇒ RecordingInstance
Fetch the RecordingInstance
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
# File 'lib/twilio-ruby/rest/voice/v2/recording.rb', line 218 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) RecordingInstance.new( @version, payload, id_or_unique_name: @solution[:id_or_unique_name], ) end |
#fetch_with_metadata ⇒ RecordingInstance
Fetch the RecordingInstanceMetadata
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'lib/twilio-ruby/rest/voice/v2/recording.rb', line 237 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) recording_instance = RecordingInstance.new( @version, response.body, id_or_unique_name: @solution[:id_or_unique_name], ) RecordingInstanceMetadata.new( @version, recording_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
317 318 319 320 |
# File 'lib/twilio-ruby/rest/voice/v2/recording.rb', line 317 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Voice.V2.RecordingContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
310 311 312 313 |
# File 'lib/twilio-ruby/rest/voice/v2/recording.rb', line 310 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Voice.V2.RecordingContext #{context}>" end |
#update(voice_v2_configuration_recording_request: :unset) ⇒ RecordingInstance
Update the RecordingInstance
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 |
# File 'lib/twilio-ruby/rest/voice/v2/recording.rb', line 263 def update(voice_v2_configuration_recording_request: :unset ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' payload = @version.update('PUT', @uri, headers: headers, data: voice_v2_configuration_recording_request.to_json) RecordingInstance.new( @version, payload, id_or_unique_name: @solution[:id_or_unique_name], ) end |
#update_with_metadata(voice_v2_configuration_recording_request: :unset) ⇒ RecordingInstance
Update the RecordingInstanceMetadata
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 |
# File 'lib/twilio-ruby/rest/voice/v2/recording.rb', line 284 def (voice_v2_configuration_recording_request: :unset ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' response = @version.('PUT', @uri, headers: headers, data: voice_v2_configuration_recording_request.to_json) recording_instance = RecordingInstance.new( @version, response.body, id_or_unique_name: @solution[:id_or_unique_name], ) RecordingInstanceMetadata.new( @version, recording_instance, response.headers, response.status_code ) end |