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

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/video/v1/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

  • room_sid (String) (defaults to: nil)

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

  • sid (String) (defaults to: nil)

    The SID of the RoomRecording resource to fetch.


239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/twilio-ruby/rest/video/v1/room/recording.rb', line 239

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'].to_i,
      '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'].to_i,
      'media_external_location' => payload['media_external_location'],
      'room_sid' => payload['room_sid'],
      'links' => payload['links'],
  }

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

Instance Method Details

#account_sidString

Returns The SID of the Account that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource


281
282
283
# File 'lib/twilio-ruby/rest/video/v1/room/recording.rb', line 281

def 
  @properties['account_sid']
end

#codecroom_recording.Codec

Returns The codec used for the recording.

Returns:

  • (room_recording.Codec)

    The codec used for the recording


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

def codec
  @properties['codec']
end

#container_formatroom_recording.Format

Returns The file format for the recording.

Returns:

  • (room_recording.Format)

    The file format for the recording


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

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:


272
273
274
275
276
277
# File 'lib/twilio-ruby/rest/video/v1/room/recording.rb', line 272

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

#date_createdTime

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

Returns:

  • (Time)

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


293
294
295
# File 'lib/twilio-ruby/rest/video/v1/room/recording.rb', line 293

def date_created
  @properties['date_created']
end

#deleteBoolean

Delete the RoomRecordingInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


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

def delete
  context.delete
end

#durationString

Returns The duration of the recording in seconds.

Returns:

  • (String)

    The duration of the recording in seconds


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

def duration
  @properties['duration']
end

#fetchRoomRecordingInstance

Fetch the RoomRecordingInstance

Returns:


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

def fetch
  context.fetch
end

#grouping_sidsHash

Returns A list of SIDs related to the Recording.

Returns:

  • (Hash)

    A list of SIDs related to the Recording


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

def grouping_sids
  @properties['grouping_sids']
end

#inspectObject

Provide a detailed, user friendly representation


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

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

Returns The URLs of related resources.

Returns:

  • (String)

    The URLs of related resources


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

def links
  @properties['links']
end

#media_external_locationString

Returns The URL of the media file associated with the recording when stored externally.

Returns:

  • (String)

    The URL of the media file associated with the recording when stored externally


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

def media_external_location
  @properties['media_external_location']
end

#offsetString

Returns The number of milliseconds between a point in time that is common to all rooms in a group and when the source room of the recording started.

Returns:

  • (String)

    The number of milliseconds between a point in time that is common to all rooms in a group and when the source room of the recording started


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

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


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

def room_sid
  @properties['room_sid']
end

#sidString

Returns The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the resource


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

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


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

def size
  @properties['size']
end

#source_sidString

Returns The SID of the recording source.

Returns:

  • (String)

    The SID of the recording source


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

def source_sid
  @properties['source_sid']
end

#statusroom_recording.Status

Returns The status of the recording.

Returns:

  • (room_recording.Status)

    The status of the recording


287
288
289
# File 'lib/twilio-ruby/rest/video/v1/room/recording.rb', line 287

def status
  @properties['status']
end

#to_sObject

Provide a user friendly representation


397
398
399
400
# File 'lib/twilio-ruby/rest/video/v1/room/recording.rb', line 397

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.

Returns:

  • (String)

    The name that was given to the source track of the recording


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

def track_name
  @properties['track_name']
end

#typeroom_recording.Type

Returns The recording's media type.

Returns:

  • (room_recording.Type)

    The recording's media type


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

def type
  @properties['type']
end

#urlString

Returns The absolute URL of the resource.

Returns:

  • (String)

    The absolute URL of the resource


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

def url
  @properties['url']
end