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

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

Instance Method Summary collapse

Constructor Details

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

Initialize the RecordingContext

Parameters:



201
202
203
204
205
206
207
208
209
# File 'lib/twilio-ruby/rest/api/v2010/account/call/recording.rb', line 201

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

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

    
end

Instance Method Details

#deleteBoolean

Delete the RecordingInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



213
214
215
216
217
218
219
220
# File 'lib/twilio-ruby/rest/api/v2010/account/call/recording.rb', line 213

def delete

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    @version.delete('DELETE', @uri, headers: headers)
end

#fetchRecordingInstance

Fetch the RecordingInstance

Returns:



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/twilio-ruby/rest/api/v2010/account/call/recording.rb', line 225

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],
        call_sid: @solution[:call_sid],
        sid: @solution[:sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



284
285
286
287
# File 'lib/twilio-ruby/rest/api/v2010/account/call/recording.rb', line 284

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

#to_sObject

Provide a user friendly representation



277
278
279
280
# File 'lib/twilio-ruby/rest/api/v2010/account/call/recording.rb', line 277

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:



248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/twilio-ruby/rest/api/v2010/account/call/recording.rb', line 248

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],
        call_sid: @solution[:call_sid],
        sid: @solution[:sid],
    )
end