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.



504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
# File 'lib/twilio-ruby/rest/video/v1/room/transcriptions.rb', line 504

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_sidString

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

Returns:



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

def 
    @properties['account_sid']
end

#configurationHash

Returns An JSON object that describes the video layout of the composition in terms of regions. See [Specifying Video Layouts](www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info.

Returns:



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

def configuration
    @properties['configuration']
end

#contextTranscriptionsContext

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

Returns:



533
534
535
536
537
538
# File 'lib/twilio-ruby/rest/video/v1/room/transcriptions.rb', line 533

def context
    unless @instance_context
        @instance_context = TranscriptionsContext.new(@version , @params['room_sid'], @params['ttid'])
    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:



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

def date_created
    @properties['date_created']
end

#date_updatedTime

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

Returns:



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

def date_updated
    @properties['date_updated']
end

#durationString

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.



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

def duration
    @properties['duration']
end

#end_timeTime

Returns The time when the transcriptions disconnected from the room in [ISO 8601](en.wikipedia.org/wiki/ISO_8601#UTC) format.

Returns:



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

def end_time
    @properties['end_time']
end

#fetchTranscriptionsInstance

Fetch the TranscriptionsInstance

Returns:



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

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#room_sidString

Returns The SID of the transcriptions’s room.

Returns:

  • (String)

    The SID of the transcriptions’s room.



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

def room_sid
    @properties['room_sid']
end

#source_sidString

Returns The SID of the transcriptions’s associated call.

Returns:

  • (String)

    The SID of the transcriptions’s associated call.



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

def source_sid
    @properties['source_sid']
end

#start_timeTime

Returns The time of transcriptions connected to the room in [ISO 8601](en.wikipedia.org/wiki/ISO_8601#UTC) format.

Returns:



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

def start_time
    @properties['start_time']
end

#statusStatus

Returns:

  • (Status)


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

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



638
639
640
641
# File 'lib/twilio-ruby/rest/video/v1/room/transcriptions.rb', line 638

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

#ttidString

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.



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

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:



625
626
627
628
629
630
631
632
633
634
# File 'lib/twilio-ruby/rest/video/v1/room/transcriptions.rb', line 625

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

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

#urlString

Returns The absolute URL of the resource.

Returns:

  • (String)

    The absolute URL of the resource.



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

def url
    @properties['url']
end