Class: Twilio::REST::Video::V1::RecordingInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/video/v1/recording.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ RecordingInstance

Initialize the RecordingInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • sid (String) (defaults to: nil)

    The SID of the Recording resource to fetch.


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

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

  # Context
  @instance_context = nil
  @params = {'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


296
297
298
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 296

def 
  @properties['account_sid']
end

#codecrecording.Codec

Returns The codec used to encode the track.

Returns:

  • (recording.Codec)

    The codec used to encode the track


356
357
358
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 356

def codec
  @properties['codec']
end

#container_formatrecording.Format

Returns The file format for the recording.

Returns:

  • (recording.Format)

    The file format for the recording


350
351
352
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 350

def container_format
  @properties['container_format']
end

#contextRecordingContext

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

Returns:


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

def context
  unless @instance_context
    @instance_context = RecordingContext.new(@version, @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


308
309
310
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 308

def date_created
  @properties['date_created']
end

#deleteBoolean

Delete the RecordingInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


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

def delete
  context.delete
end

#durationString

Returns The duration of the recording in seconds.

Returns:

  • (String)

    The duration of the recording in seconds


344
345
346
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 344

def duration
  @properties['duration']
end

#fetchRecordingInstance

Fetch the RecordingInstance

Returns:


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

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


362
363
364
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 362

def grouping_sids
  @properties['grouping_sids']
end

#inspectObject

Provide a detailed, user friendly representation


407
408
409
410
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 407

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

Returns The URLs of related resources.

Returns:

  • (String)

    The URLs of related resources


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

def links
  @properties['links']
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


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

def offset
  @properties['offset']
end

#sidString

Returns The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the resource


314
315
316
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 314

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


326
327
328
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 326

def size
  @properties['size']
end

#source_sidString

Returns The SID of the recording source.

Returns:

  • (String)

    The SID of the recording source


320
321
322
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 320

def source_sid
  @properties['source_sid']
end

#statusrecording.Status

Returns The status of the recording.

Returns:

  • (recording.Status)

    The status of the recording


302
303
304
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 302

def status
  @properties['status']
end

#to_sObject

Provide a user friendly representation


400
401
402
403
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 400

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


368
369
370
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 368

def track_name
  @properties['track_name']
end

#typerecording.Type

Returns The recording's media type.

Returns:

  • (recording.Type)

    The recording's media type


338
339
340
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 338

def type
  @properties['type']
end

#urlString

Returns The absolute URL of the resource.

Returns:

  • (String)

    The absolute URL of the resource


332
333
334
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 332

def url
  @properties['url']
end