Class: Twilio::REST::Video::V1::RecordingInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/video/v1/recording.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ RecordingInstance

Initialize the RecordingInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this Recording resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 457

def initialize(version, payload , sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'status' => payload['status'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'sid' => payload['sid'],
        'source_sid' => payload['source_sid'],
        'size' => payload['size'],
        'url' => payload['url'],
        'type' => payload['type'],
        'duration' => payload['duration'] == nil ? payload['duration'] : payload['duration'].to_i,
        'container_format' => payload['container_format'],
        'codec' => payload['codec'],
        'grouping_sids' => payload['grouping_sids'],
        'track_name' => payload['track_name'],
        'offset' => payload['offset'],
        'media_external_location' => payload['media_external_location'],
        'status_callback' => payload['status_callback'],
        'status_callback_method' => payload['status_callback_method'],
        'links' => payload['links'],
    }

    # Context
    @instance_context = nil
    @params = { 'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#account_sidString

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

Returns:



501
502
503
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 501

def 
    @properties['account_sid']
end

#codecCodec

Returns:

  • (Codec)


561
562
563
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 561

def codec
    @properties['codec']
end

#container_formatFormat

Returns:

  • (Format)


555
556
557
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 555

def container_format
    @properties['container_format']
end

#contextRecordingContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



492
493
494
495
496
497
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 492

def context
    unless @instance_context
        @instance_context = RecordingContext.new(@version , @params['sid'])
    end
    @instance_context
end

#date_createdTime

Returns The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



513
514
515
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 513

def date_created
    @properties['date_created']
end

#deleteBoolean

Delete the RecordingInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



610
611
612
613
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 610

def delete

    context.delete
end

#durationString

Returns The duration of the recording in seconds rounded to the nearest second. Sub-second tracks have a Duration property of 1 second.

Returns:

  • (String)

    The duration of the recording in seconds rounded to the nearest second. Sub-second tracks have a Duration property of 1 second



549
550
551
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 549

def duration
    @properties['duration']
end

#fetchRecordingInstance

Fetch the RecordingInstance

Returns:



618
619
620
621
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 618

def fetch

    context.fetch
end

#grouping_sidsHash

Returns A list of SIDs related to the recording. Includes the room_sid and participant_sid.

Returns:

  • (Hash)

    A list of SIDs related to the recording. Includes the room_sid and participant_sid.



567
568
569
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 567

def grouping_sids
    @properties['grouping_sids']
end

#inspectObject

Provide a detailed, user friendly representation



632
633
634
635
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 632

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Video.V1.RecordingInstance #{values}>"
end

Returns The URLs of related resources.

Returns:

  • (Hash)

    The URLs of related resources.



603
604
605
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 603

def links
    @properties['links']
end

#media_external_locationString

Returns The URL of the media file associated with the recording when stored externally. See [External S3 Recordings](/docs/video/api/external-s3-recordings) for more details.

Returns:

  • (String)

    The URL of the media file associated with the recording when stored externally. See [External S3 Recordings](/docs/video/api/external-s3-recordings) for more details.



585
586
587
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 585

def media_external_location
    @properties['media_external_location']
end

#offsetString

Returns The time in milliseconds elapsed between an arbitrary point in time, common to all group rooms, and the moment when the source room of this track started. This information provides a synchronization mechanism for recordings belonging to the same room.

Returns:

  • (String)

    The time in milliseconds elapsed between an arbitrary point in time, common to all group rooms, and the moment when the source room of this track started. This information provides a synchronization mechanism for recordings belonging to the same room.



579
580
581
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 579

def offset
    @properties['offset']
end

#sidString

Returns The unique string that we created to identify the Recording resource.

Returns:

  • (String)

    The unique string that we created to identify the Recording resource.



519
520
521
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 519

def sid
    @properties['sid']
end

#sizeString

Returns The size of the recorded track, in bytes.

Returns:

  • (String)

    The size of the recorded track, in bytes.



531
532
533
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 531

def size
    @properties['size']
end

#source_sidString

Returns The SID of the recording source. For a Room Recording, this value is a track_sid.

Returns:

  • (String)

    The SID of the recording source. For a Room Recording, this value is a track_sid.



525
526
527
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 525

def source_sid
    @properties['source_sid']
end

#statusStatus

Returns:

  • (Status)


507
508
509
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 507

def status
    @properties['status']
end

#status_callbackString

Returns The URL called using the status_callback_method to send status information on every recording event.

Returns:

  • (String)

    The URL called using the status_callback_method to send status information on every recording event.



591
592
593
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 591

def status_callback
    @properties['status_callback']
end

#status_callback_methodString

Returns The HTTP method used to call status_callback. Can be: POST or GET, defaults to POST.

Returns:

  • (String)

    The HTTP method used to call status_callback. Can be: POST or GET, defaults to POST.



597
598
599
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 597

def status_callback_method
    @properties['status_callback_method']
end

#to_sObject

Provide a user friendly representation



625
626
627
628
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 625

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Video.V1.RecordingInstance #{values}>"
end

#track_nameString

Returns The name that was given to the source track of the recording. If no name is given, the source_sid is used.

Returns:

  • (String)

    The name that was given to the source track of the recording. If no name is given, the source_sid is used.



573
574
575
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 573

def track_name
    @properties['track_name']
end

#typeType

Returns:

  • (Type)


543
544
545
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 543

def type
    @properties['type']
end

#urlString

Returns The absolute URL of the resource.

Returns:

  • (String)

    The absolute URL of the resource.



537
538
539
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 537

def url
    @properties['url']
end