Class: Twilio::REST::Video::V1::RoomContext::RoomRecordingInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, room_sid: nil, sid: nil) ⇒ RoomRecordingInstance

Initialize the RoomRecordingInstance

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

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 258

def initialize(version, payload , room_sid: nil, 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'],
        'room_sid' => payload['room_sid'],
        'links' => payload['links'],
    }

    # Context
    @instance_context = nil
    @params = { 'room_sid' => room_sid  || @properties['room_sid']  ,'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 RoomRecording resource.

Returns:



300
301
302
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 300

def 
    @properties['account_sid']
end

#codecCodec

Returns:

  • (Codec)


360
361
362
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 360

def codec
    @properties['codec']
end

#container_formatFormat

Returns:

  • (Format)


354
355
356
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 354

def container_format
    @properties['container_format']
end

#contextRoomRecordingContext

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

Returns:



291
292
293
294
295
296
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 291

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



312
313
314
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 312

def date_created
    @properties['date_created']
end

#deleteBoolean

Delete the RoomRecordingInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



403
404
405
406
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 403

def delete

    context.delete
end

#durationString

Returns The duration of the recording rounded to the nearest second. Sub-second duration tracks have a ‘duration` of 1 second.

Returns:

  • (String)

    The duration of the recording rounded to the nearest second. Sub-second duration tracks have a ‘duration` of 1 second



348
349
350
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 348

def duration
    @properties['duration']
end

#fetchRoomRecordingInstance

Fetch the RoomRecordingInstance

Returns:



411
412
413
414
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 411

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`.



366
367
368
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 366

def grouping_sids
    @properties['grouping_sids']
end

#inspectObject

Provide a detailed, user friendly representation



425
426
427
428
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 425

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

Returns The URLs of related resources.

Returns:

  • (Hash)

    The URLs of related resources.



396
397
398
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 396

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.



384
385
386
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 384

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.



378
379
380
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 378

def offset
    @properties['offset']
end

#room_sidString

Returns The SID of the Room resource the recording is associated with.

Returns:

  • (String)

    The SID of the Room resource the recording is associated with.



390
391
392
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 390

def room_sid
    @properties['room_sid']
end

#sidString

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

Returns:

  • (String)

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



318
319
320
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 318

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.



330
331
332
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 330

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`.



324
325
326
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 324

def source_sid
    @properties['source_sid']
end

#statusStatus

Returns:

  • (Status)


306
307
308
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 306

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



418
419
420
421
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 418

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Video.V1.RoomRecordingInstance #{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.



372
373
374
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 372

def track_name
    @properties['track_name']
end

#typeType

Returns:

  • (Type)


342
343
344
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 342

def type
    @properties['type']
end

#urlString

Returns The absolute URL of the resource.

Returns:

  • (String)

    The absolute URL of the resource.



336
337
338
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 336

def url
    @properties['url']
end