Class: Twilio::REST::Video::V1::RecordingInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Video::V1::RecordingInstance
- Defined in:
- lib/twilio-ruby/rest/video/v1/recording.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
Twilio Account SID.
-
#codec ⇒ recording.Codec
The codec used to encode the track.
-
#container_format ⇒ recording.Format
The file format for this Recording.
-
#context ⇒ RecordingContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
Date when the media recording began writing.
-
#delete ⇒ Boolean
Deletes the RecordingInstance.
-
#duration ⇒ String
Duration of the Recording in seconds.
-
#fetch ⇒ RecordingInstance
Fetch a RecordingInstance.
-
#grouping_sids ⇒ Hash
A list of Sids related to this Recording.
-
#initialize(version, payload, sid: nil) ⇒ RecordingInstance
constructor
Initialize the RecordingInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The links.
-
#offset ⇒ String
Offset in miliseconds for this track.
-
#sid ⇒ String
A 34-character string that uniquely identifies this Recording.
-
#size ⇒ String
Size of the recorded track, in bytes.
-
#source_sid ⇒ String
A 34-character string that uniquely identifies the source of this Recording.
-
#status ⇒ recording.Status
The status of the Recording.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#track_name ⇒ String
The name that was given to the source track of this recording.
-
#type ⇒ recording.Type
Indicates the media type for this recording.
-
#url ⇒ String
The absolute URL for this resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ RecordingInstance
Initialize the RecordingInstance
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 269 |
# 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'], 'offset' => payload['offset'].to_i, 'links' => payload['links'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns Twilio Account SID.
284 285 286 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 284 def account_sid @properties['account_sid'] end |
#codec ⇒ recording.Codec
Returns The codec used to encode the track.
344 345 346 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 344 def codec @properties['codec'] end |
#container_format ⇒ recording.Format
Returns The file format for this Recording.
338 339 340 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 338 def container_format @properties['container_format'] end |
#context ⇒ RecordingContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
275 276 277 278 279 280 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 275 def context unless @instance_context @instance_context = RecordingContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns Date when the media recording began writing.
296 297 298 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 296 def date_created @properties['date_created'] end |
#delete ⇒ Boolean
Deletes the RecordingInstance
382 383 384 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 382 def delete context.delete end |
#duration ⇒ String
Returns Duration of the Recording in seconds.
332 333 334 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 332 def duration @properties['duration'] end |
#fetch ⇒ RecordingInstance
Fetch a RecordingInstance
375 376 377 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 375 def fetch context.fetch end |
#grouping_sids ⇒ Hash
Returns A list of Sids related to this Recording.
350 351 352 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 350 def grouping_sids @properties['grouping_sids'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
395 396 397 398 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 395 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.RecordingInstance #{values}>" end |
#links ⇒ String
Returns The links.
368 369 370 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 368 def links @properties['links'] end |
#offset ⇒ String
Returns Offset in miliseconds for this track.
362 363 364 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 362 def offset @properties['offset'] end |
#sid ⇒ String
Returns A 34-character string that uniquely identifies this Recording.
302 303 304 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 302 def sid @properties['sid'] end |
#size ⇒ String
Returns Size of the recorded track, in bytes.
314 315 316 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 314 def size @properties['size'] end |
#source_sid ⇒ String
Returns A 34-character string that uniquely identifies the source of this Recording.
308 309 310 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 308 def source_sid @properties['source_sid'] end |
#status ⇒ recording.Status
Returns The status of the Recording.
290 291 292 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 290 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
388 389 390 391 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 388 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.RecordingInstance #{values}>" end |
#track_name ⇒ String
Returns The name that was given to the source track of this recording.
356 357 358 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 356 def track_name @properties['track_name'] end |
#type ⇒ recording.Type
Returns Indicates the media type for this recording.
326 327 328 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 326 def type @properties['type'] end |
#url ⇒ String
Returns The absolute URL for this resource.
320 321 322 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 320 def url @properties['url'] end |