class Twilio::REST::Api::V2010::AccountContext::CallContext::RecordingInstance
Public Class Methods
Initialize the RecordingInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] account_sid
The SID of the
{Account}[https://www.twilio.com/docs/iam/api/account] that created the Recording resource.
@param [String] call_sid
The SID of the
{Call}[https://www.twilio.com/docs/voice/api/call-resource] the Recording resource is associated with.
@param [String] sid The Twilio-provided string that uniquely identifies the
Recording resource to fetch.
@return [RecordingInstance] RecordingInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 321 def initialize(version, payload, account_sid: nil, call_sid: nil, sid: nil) 322 super(version) 323 324 # Marshaled Properties 325 @properties = { 326 'account_sid' => payload['account_sid'], 327 'api_version' => payload['api_version'], 328 'call_sid' => payload['call_sid'], 329 'conference_sid' => payload['conference_sid'], 330 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), 331 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 332 'start_time' => Twilio.deserialize_rfc2822(payload['start_time']), 333 'duration' => payload['duration'], 334 'sid' => payload['sid'], 335 'price' => payload['price'].to_f, 336 'uri' => payload['uri'], 337 'encryption_details' => payload['encryption_details'], 338 'price_unit' => payload['price_unit'], 339 'status' => payload['status'], 340 'channels' => payload['channels'].to_i, 341 'source' => payload['source'], 342 'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i, 343 'track' => payload['track'], 344 } 345 346 # Context 347 @instance_context = nil 348 @params = {'account_sid' => account_sid, 'call_sid' => call_sid, 'sid' => sid || @properties['sid'], } 349 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 369 def account_sid 370 @properties['account_sid'] 371 end
@return [String] The API version used to make the recording
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 375 def api_version 376 @properties['api_version'] 377 end
@return [String] The SID of the Call the resource is associated with
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 381 def call_sid 382 @properties['call_sid'] 383 end
@return [String] The number of channels in the final recording file
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 453 def channels 454 @properties['channels'] 455 end
@return [String] The Conference SID that identifies the conference associated with the recording
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 387 def conference_sid 388 @properties['conference_sid'] 389 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [RecordingContext] RecordingContext
for this RecordingInstance
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 355 def context 356 unless @instance_context 357 @instance_context = RecordingContext.new( 358 @version, 359 @params['account_sid'], 360 @params['call_sid'], 361 @params['sid'], 362 ) 363 end 364 @instance_context 365 end
@return [Time] The RFC 2822 date and time in GMT that the resource was created
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 393 def date_created 394 @properties['date_created'] 395 end
@return [Time] The RFC 2822 date and time in GMT that the resource was last updated
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 399 def date_updated 400 @properties['date_updated'] 401 end
Delete the RecordingInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 499 def delete 500 context.delete 501 end
@return [String] The length of the recording in seconds
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 411 def duration 412 @properties['duration'] 413 end
@return [Hash] How to decrypt the recording.
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 435 def encryption_details 436 @properties['encryption_details'] 437 end
@return [String] More information about why the recording is missing, if status is `absent`.
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 465 def error_code 466 @properties['error_code'] 467 end
Fetch the RecordingInstance
@return [RecordingInstance] Fetched RecordingInstance
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 492 def fetch 493 context.fetch 494 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 512 def inspect 513 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 514 "<Twilio.Api.V2010.RecordingInstance #{values}>" 515 end
@return [String] The one-time cost of creating the recording.
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 423 def price 424 @properties['price'] 425 end
@return [String] The currency used in the price property.
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 441 def price_unit 442 @properties['price_unit'] 443 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 417 def sid 418 @properties['sid'] 419 end
@return [recording.Source] How the recording was created
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 459 def source 460 @properties['source'] 461 end
@return [Time] The start time of the recording, given in RFC 2822 format
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 405 def start_time 406 @properties['start_time'] 407 end
@return [recording.Status] The status of the recording
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 447 def status 448 @properties['status'] 449 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 505 def to_s 506 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 507 "<Twilio.Api.V2010.RecordingInstance #{values}>" 508 end
@return [String] The recorded track. Can be: `inbound`, `outbound`, or `both`.
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 471 def track 472 @properties['track'] 473 end
Update the RecordingInstance
@param [recording.Status] status The new status of the recording. Can be:
`stopped`, `paused`, `in-progress`.
@param [String] pause_behavior 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`.
@return [RecordingInstance] Updated RecordingInstance
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 485 def update(status: nil, pause_behavior: :unset) 486 context.update(status: status, pause_behavior: pause_behavior, ) 487 end
@return [String] The URI of the resource, relative to `api.twilio.com`
# File lib/twilio-ruby/rest/api/v2010/account/call/recording.rb 429 def uri 430 @properties['uri'] 431 end