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 Recording Sid that uniquely identifies the Recording to fetch.



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

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

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

Instance Method Details

#account_sidString

Returns Twilio Account SID.

Returns:

  • (String)

    Twilio Account SID.



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

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.



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

def codec
  @properties['codec']
end

#container_formatrecording.Format

Returns The file format for this Recording.

Returns:

  • (recording.Format)

    The file format for this Recording.



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

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:



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

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

#date_createdTime

Returns Date when the media recording began writing.

Returns:

  • (Time)

    Date when the media recording began writing.



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

def date_created
  @properties['date_created']
end

#deleteBoolean

Deletes the RecordingInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



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

def delete
  context.delete
end

#durationString

Returns Duration of the Recording in seconds.

Returns:

  • (String)

    Duration of the Recording in seconds.



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

def duration
  @properties['duration']
end

#fetchRecordingInstance

Fetch a RecordingInstance

Returns:



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

def fetch
  context.fetch
end

#grouping_sidsHash

Returns A list of Sids related to this Recording.

Returns:

  • (Hash)

    A list of Sids related to this Recording.



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

def grouping_sids
  @properties['grouping_sids']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

Returns The links.

Returns:

  • (String)

    The links



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

def links
  @properties['links']
end

#sidString

Returns A 34-character string that uniquely identifies this Recording.

Returns:

  • (String)

    A 34-character string that uniquely identifies this Recording.



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

def sid
  @properties['sid']
end

#sizeString

Returns Size of the recorded track, in bytes.

Returns:

  • (String)

    Size of the recorded track, in bytes.



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

def size
  @properties['size']
end

#source_sidString

Returns A 34-character string that uniquely identifies the source of this Recording.

Returns:

  • (String)

    A 34-character string that uniquely identifies the source of this Recording.



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

def source_sid
  @properties['source_sid']
end

#statusrecording.Status

Returns The status of the Recording.

Returns:

  • (recording.Status)

    The status of the Recording.



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

def status
  @properties['status']
end

#to_sObject

Provide a user friendly representation



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

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 this recording.

Returns:

  • (String)

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



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

def track_name
  @properties['track_name']
end

#typerecording.Type

Returns Indicates the media type for this recording.

Returns:

  • (recording.Type)

    Indicates the media type for this recording.



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

def type
  @properties['type']
end

#urlString

Returns The absolute URL for this resource.

Returns:

  • (String)

    The absolute URL for this resource.



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

def url
  @properties['url']
end