Class: Twilio::REST::Video::V1::RoomContext::TranscriptionsInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/video/v1/room/transcriptions.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, room_sid: nil, ttid: nil) ⇒ TranscriptionsInstance

Initialize the TranscriptionsInstance

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 Transcriptions resource.

  • sid (String) —

    The SID of the Call resource to fetch.



512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
# File 'lib/twilio-ruby/rest/video/v1/room/transcriptions.rb', line 512

def initialize(version, payload , room_sid: nil, ttid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'ttid' => payload['ttid'],
        'account_sid' => payload['account_sid'],
        'room_sid' => payload['room_sid'],
        'source_sid' => payload['source_sid'],
        'status' => payload['status'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'start_time' => Twilio.deserialize_iso8601_datetime(payload['start_time']),
        'end_time' => Twilio.deserialize_iso8601_datetime(payload['end_time']),
        'duration' => payload['duration'] == nil ? payload['duration'] : payload['duration'].to_i,
        'url' => payload['url'],
        'configuration' => payload['configuration'],
    }

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

Instance Method Details

#account_sid ⇒ String

Returns The SID of the Account that created the Room resource.

Returns:

  • (String) —

    The SID of the Account that created the Room resource.



556
557
558
# File 'lib/twilio-ruby/rest/video/v1/room/transcriptions.rb', line 556

def 
    @properties['account_sid']
end

#configuration ⇒ Hash

Returns An JSON object that describes the video layout of the composition in terms of regions. See Specifying Video Layouts for more info.

Returns:

  • (Hash) —

    An JSON object that describes the video layout of the composition in terms of regions. See Specifying Video Layouts for more info.



616
617
618
# File 'lib/twilio-ruby/rest/video/v1/room/transcriptions.rb', line 616

def configuration
    @properties['configuration']
end

#context ⇒ TranscriptionsContext

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

Returns:



541
542
543
544
545
546
# File 'lib/twilio-ruby/rest/video/v1/room/transcriptions.rb', line 541

def context
    unless @instance_context
        @instance_context = TranscriptionsContext.new(@version , @params['room_sid'], @params['ttid'])
    end
    @instance_context
end

#date_created ⇒ Time

Returns The date and time in GMT when the resource was created specified in ISO 8601 format.

Returns:

  • (Time) —

    The date and time in GMT when the resource was created specified in ISO 8601 format.



580
581
582
# File 'lib/twilio-ruby/rest/video/v1/room/transcriptions.rb', line 580

def date_created
    @properties['date_created']
end

#date_updated ⇒ Time

Returns The date and time in GMT when the resource was last updated specified in ISO 8601 format.

Returns:

  • (Time) —

    The date and time in GMT when the resource was last updated specified in ISO 8601 format.



586
587
588
# File 'lib/twilio-ruby/rest/video/v1/room/transcriptions.rb', line 586

def date_updated
    @properties['date_updated']
end

#duration ⇒ String

Returns The duration in seconds that the transcriptions were connected. Populated only after the transcriptions is stopped.

Returns:

  • (String) —

    The duration in seconds that the transcriptions were connected. Populated only after the transcriptions is stopped.



604
605
606
# File 'lib/twilio-ruby/rest/video/v1/room/transcriptions.rb', line 604

def duration
    @properties['duration']
end

#end_time ⇒ Time

Returns The time when the transcriptions disconnected from the room in ISO 8601 format.

Returns:

  • (Time) —

    The time when the transcriptions disconnected from the room in ISO 8601 format.



598
599
600
# File 'lib/twilio-ruby/rest/video/v1/room/transcriptions.rb', line 598

def end_time
    @properties['end_time']
end

#fetch ⇒ TranscriptionsInstance

Fetch the TranscriptionsInstance

Returns:



623
624
625
626
# File 'lib/twilio-ruby/rest/video/v1/room/transcriptions.rb', line 623

def fetch

    context.fetch
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



653
654
655
656
# File 'lib/twilio-ruby/rest/video/v1/room/transcriptions.rb', line 653

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

#room_sid ⇒ String

Returns The SID of the transcriptions's room.

Returns:

  • (String) —

    The SID of the transcriptions's room.



562
563
564
# File 'lib/twilio-ruby/rest/video/v1/room/transcriptions.rb', line 562

def room_sid
    @properties['room_sid']
end

#source_sid ⇒ String

Returns The SID of the transcriptions's associated call.

Returns:

  • (String) —

    The SID of the transcriptions's associated call.



568
569
570
# File 'lib/twilio-ruby/rest/video/v1/room/transcriptions.rb', line 568

def source_sid
    @properties['source_sid']
end

#start_time ⇒ Time

Returns The time of transcriptions connected to the room in ISO 8601 format.

Returns:

  • (Time) —

    The time of transcriptions connected to the room in ISO 8601 format.



592
593
594
# File 'lib/twilio-ruby/rest/video/v1/room/transcriptions.rb', line 592

def start_time
    @properties['start_time']
end

#status ⇒ Status

Returns:

  • (Status)


574
575
576
# File 'lib/twilio-ruby/rest/video/v1/room/transcriptions.rb', line 574

def status
    @properties['status']
end

#to_s ⇒ Object

Provide a user friendly representation



646
647
648
649
# File 'lib/twilio-ruby/rest/video/v1/room/transcriptions.rb', line 646

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

#ttid ⇒ String

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

Returns:

  • (String) —

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



550
551
552
# File 'lib/twilio-ruby/rest/video/v1/room/transcriptions.rb', line 550

def ttid
    @properties['ttid']
end

#update(status: :unset, configuration: :unset) ⇒ TranscriptionsInstance

Update the TranscriptionsInstance

Parameters:

  • status (Status) (defaults to: :unset)
  • configuration (Object) (defaults to: :unset) —

    A collection of properties that describe transcription behaviour.

Returns:



633
634
635
636
637
638
639
640
641
642
# File 'lib/twilio-ruby/rest/video/v1/room/transcriptions.rb', line 633

def update(
  status: :unset, 
  configuration: :unset
)

    context.update(
        status: status, 
        configuration: configuration, 
    )
end

#url ⇒ String

Returns The absolute URL of the resource.

Returns:

  • (String) —

    The absolute URL of the resource.



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

def url
    @properties['url']
end