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 room_sid

  • sid (String) (defaults to: nil)

    The sid



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

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,
      '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 account_sid.

Returns:

  • (String)

    The account_sid



276
277
278
# File 'lib/twilio-ruby/rest/video/v1/room/recording.rb', line 276

def 
  @properties['account_sid']
end

#codecroom_recording.Codec

Returns The codec.

Returns:

  • (room_recording.Codec)

    The codec



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

def codec
  @properties['codec']
end

#container_formatroom_recording.Format

Returns The container_format.

Returns:

  • (room_recording.Format)

    The container_format



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

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:



267
268
269
270
271
272
# File 'lib/twilio-ruby/rest/video/v1/room/recording.rb', line 267

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

#date_createdTime

Returns The date_created.

Returns:

  • (Time)

    The date_created



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

def date_created
  @properties['date_created']
end

#deleteBoolean

Deletes the RoomRecordingInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



380
381
382
# File 'lib/twilio-ruby/rest/video/v1/room/recording.rb', line 380

def delete
  context.delete
end

#durationString

Returns The duration.

Returns:

  • (String)

    The duration



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

def duration
  @properties['duration']
end

#fetchRoomRecordingInstance

Fetch a RoomRecordingInstance

Returns:



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

def fetch
  context.fetch
end

#grouping_sidsHash

Returns The grouping_sids.

Returns:

  • (Hash)

    The grouping_sids



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

def grouping_sids
  @properties['grouping_sids']
end

#inspectObject

Provide a detailed, user friendly representation



393
394
395
396
# File 'lib/twilio-ruby/rest/video/v1/room/recording.rb', line 393

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

Returns The links.

Returns:

  • (String)

    The links



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

def links
  @properties['links']
end

#offsetString

Returns The offset.

Returns:

  • (String)

    The offset



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

def offset
  @properties['offset']
end

#room_sidString

Returns The room_sid.

Returns:

  • (String)

    The room_sid



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

def room_sid
  @properties['room_sid']
end

#sidString

Returns The sid.

Returns:

  • (String)

    The sid



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

def sid
  @properties['sid']
end

#sizeString

Returns The size.

Returns:

  • (String)

    The size



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

def size
  @properties['size']
end

#source_sidString

Returns The source_sid.

Returns:

  • (String)

    The source_sid



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

def source_sid
  @properties['source_sid']
end

#statusroom_recording.Status

Returns The status.

Returns:

  • (room_recording.Status)

    The status



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

def status
  @properties['status']
end

#to_sObject

Provide a user friendly representation



386
387
388
389
# File 'lib/twilio-ruby/rest/video/v1/room/recording.rb', line 386

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

#track_nameString

Returns The track_name.

Returns:

  • (String)

    The track_name



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

def track_name
  @properties['track_name']
end

#typeroom_recording.Type

Returns The type.

Returns:

  • (room_recording.Type)

    The type



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

def type
  @properties['type']
end

#urlString

Returns The url.

Returns:

  • (String)

    The url



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

def url
  @properties['url']
end