Class: Twilio::REST::Api::V2010::AccountContext::ConferenceContext::RecordingContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, account_sid, conference_sid, sid) ⇒ RecordingContext

Initialize the RecordingContext

Parameters:

  • version (Version)

    Version that contains the resource

  • account_sid (String)

    The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Conference Recording resource to update.

  • conference_sid (String)

    The Conference SID that identifies the conference associated with the recording to update.

  • sid (String)

    The Twilio-provided string that uniquely identifies the Conference Recording resource to update. Use ‘Twilio.CURRENT` to reference the current active recording.



196
197
198
199
200
201
202
203
204
205
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb', line 196

def initialize(version, , conference_sid, sid)
    super(version)
    

    # Path Solution
    @solution = { account_sid: , conference_sid: conference_sid, sid: sid,  }
    @uri = "/Accounts/#{@solution[:account_sid]}/Conferences/#{@solution[:conference_sid]}/Recordings/#{@solution[:sid]}.json"

    
end

Instance Method Details

#deleteBoolean

Delete the RecordingInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



209
210
211
212
213
214
215
216
217
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb', line 209

def delete

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    

    @version.delete('DELETE', @uri, headers: headers)
end

#delete_with_metadataBoolean

Delete the RecordingInstanceMetadata

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb', line 222

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

#fetchRecordingInstance

Fetch the RecordingInstance

Returns:



241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb', line 241

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    RecordingInstance.new(
        @version,
        payload,
        account_sid: @solution[:account_sid],
        conference_sid: @solution[:conference_sid],
        sid: @solution[:sid],
    )
end

#fetch_with_metadataRecordingInstance

Fetch the RecordingInstanceMetadata

Returns:



262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb', line 262

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,
        account_sid: @solution[:account_sid],
        conference_sid: @solution[:conference_sid],
        sid: @solution[:sid],
    )
    RecordingInstanceMetadata.new(
        @version,
        recording_instance,
        response.headers,
        response.status_code
    )
end

#inspectObject

Provide a detailed, user friendly representation



364
365
366
367
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb', line 364

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Api.V2010.RecordingContext #{context}>"
end

#to_sObject

Provide a user friendly representation



357
358
359
360
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb', line 357

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Api.V2010.RecordingContext #{context}>"
end

#update(status: nil, pause_behavior: :unset) ⇒ RecordingInstance

Update the RecordingInstance

Parameters:

  • status (Status) (defaults to: nil)
  • pause_behavior (String) (defaults to: :unset)

    Whether to record during a pause. Can be: ‘skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`.

Returns:



291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb', line 291

def update(
  status: nil, 
  pause_behavior: :unset
)

    data = Twilio::Values.of({
        'Status' => status,
        'PauseBehavior' => pause_behavior,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.update('POST', @uri, data: data, headers: headers)
    RecordingInstance.new(
        @version,
        payload,
        account_sid: @solution[:account_sid],
        conference_sid: @solution[:conference_sid],
        sid: @solution[:sid],
    )
end

#update_with_metadata(status: nil, pause_behavior: :unset) ⇒ RecordingInstance

Update the RecordingInstanceMetadata

Parameters:

  • status (Status) (defaults to: nil)
  • pause_behavior (String) (defaults to: :unset)

    Whether to record during a pause. Can be: ‘skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`.

Returns:



322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb', line 322

def (
  status: nil, 
  pause_behavior: :unset
)

    data = Twilio::Values.of({
        'Status' => status,
        'PauseBehavior' => pause_behavior,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('POST', @uri, data: data, headers: headers)
    recording_instance = RecordingInstance.new(
        @version,
        response.body,
        account_sid: @solution[:account_sid],
        conference_sid: @solution[:conference_sid],
        sid: @solution[:sid],
    )
    RecordingInstanceMetadata.new(
        @version,
        recording_instance,
        response.headers,
        response.status_code
    )
end